// 打车题目
class Car {
    constructor(num, name) {
        this.num = num
        this.name = name
    }
}

class KuaiChe extends Car {
    constructor(num, name) {
        super(num, name)
        this.price = 2
    }
}

class ZhuanChe extends Car {
    constructor(num, name) {
        super(num, name)
        this.price = 1
    }
}

class XingCheng {
    constructor(car) {
        this.car = car
    }
    start() {
        //显示行程信息 车牌号 名字
        console.log(`车牌号：${this.car.num}  名字: ${this.car.name}`)
    }
    end() {
        //显示行程信息 车牌号 名字
        console.log(`车牌号：${this.car.num}  费用: ${this.car.price * 5}`)
    }
}

let car1 = new ZhuanChe(111, "宝马")
let car2 = new KuaiChe(222, "奔驰")
let x1 = new XingCheng(car1)
x1.start()
x1.end()